package com.gitee.ice1938.module.admin.filemanager.fun;

import java.io.Serializable;

import javax.jcr.Binary;

import org.apache.jackrabbit.JcrConstants;

/**
 * 存储文件信息
 * 
 * @author ice1938@qq.com 2019-12-5
 *
 */
public class FileNode implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -8414884622972010358L;

	/** 节点的ID */
	private String nodeId;

	/** 文件名字 */
	private String nodeName;

	/** 文件类型 */
	private String fileType;
	/**
	 * JcrConstants.NT_FILE & JcrConstants.NT_FOLDER
	 */
	private String ntType;

	/** 修改的日期 */
	private long lastModified;
	/**
	 * 数据内容
	 */
	private Binary data;

	public FileNode(String nodeId, String fileName, String fileType, long lastModified, Binary data) {
		super();
		this.nodeId = nodeId;
		this.nodeName = fileName;
		this.fileType = fileType;
		this.lastModified = lastModified;
		this.data = data;
		this.ntType = JcrConstants.NT_FILE;
	}

	public FileNode(String nodeId, String fileName) {
	    this.nodeId = nodeId;
	    this.nodeName = fileName;
	    this.ntType = JcrConstants.NT_FOLDER;
    }

	public String getNodeId() {
		return nodeId;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	public String getFileName() {
		return nodeName;
	}

	public void setFileName(String fileName) {
		this.nodeName = fileName;
	}

	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	public Binary getData() {
		return data;
	}

	public void setData(Binary data) {
		this.data = data;
	}

	public long getLastModified() {
		return lastModified;
	}

	public void setLastModified(long lastModified) {
		this.lastModified = lastModified;
	}

	public String getNtType() {
		return ntType;
	}

	public void setNtType(String ntType) {
		this.ntType = ntType;
	}

	public String getNodeName() {
		return nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	@Override
    public String toString() {
	    return "FileNode [nodeId=" + nodeId + ", nodeName=" + nodeName + ", fileType=" + fileType + ", ntType="
	            + ntType + ", lastModified=" + lastModified + ", data=" + data + "]";
    }
}
